package mi.controls.highlight
{
	/**
	 * 常用语法高亮辅助常量表达式
	 */
	public class HLConstant
	{
		/** 
		 * 多行注释 
		 */ 
		public static var MULTI_COMMENT:String = "/\\*[^*]*\\*+(?:[^/*][^*]*\\*+)*/"; 
		
		/** 
		 * 单行注释 
		 */ 
		public static var SINGLE_COMMENT:String = "//[^\\r\\n]*+"; 
		
		/** 
		 * 字符串 
		 */ 
		public static var  QUOTE_STRING:String = "\"[^\\\\\"]*(?:\\\\.[^\\\\\"]*)*\""; 
		
		/** 
		 * 字符 
		 */ 
		public static var  QUOTE_CHAR:String = "'[^\\\\']*(?:\\\\.[^\\\\']*)*'"; 
		
		/** 
		 * 高亮标签  
		 */ 
		public static var HIGHLIGHT_HTML_TAG:String = " <span(?s:.+?)/span>"; 
		
		/**
		 * 非语法
		 */
		public static var REGEX_UN_LANGUAGE:String="(" + HIGHLIGHT_HTML_TAG + "|" + MULTI_COMMENT + "|" + QUOTE_STRING + "|" + SINGLE_COMMENT + ")"; 
		
		public static var REGEX_RETURN:RegExp=new RegExp("\\r","g");
		
		/** 
		 * 匹配字符串的正则表达式 
		 */ 
		public static var REGEX_QUOTE_STRING:RegExp = new RegExp( 
			"(" + HIGHLIGHT_HTML_TAG + "|" + SINGLE_COMMENT + "|" + MULTI_COMMENT + ")|" + 
			"(" + QUOTE_STRING + ")" ,"g"    
		); 
		
		/** 
		 * 匹配字符的正则表达式 
		 */     
		public static var REGEX_QUOTE_CHAR:RegExp = new RegExp( 
			"(" + HIGHLIGHT_HTML_TAG + "|" + SINGLE_COMMENT + "|" + MULTI_COMMENT + ")|" + 
			"(" + QUOTE_CHAR + ")","g"       
		); 
		
		/** 
		 * 匹配多行注释的正则表达式 
		 */ 
		public static var REGEX_MULTI_COMMENT:RegExp = new RegExp( 
			"(" + HIGHLIGHT_HTML_TAG + "|" + SINGLE_COMMENT + "|" + QUOTE_STRING + ")|" + 
			"(" + MULTI_COMMENT + ")"  ,"gm"     
		); 
		
		/** 
		 * 匹配单行注释的正则表达式 
		 */ 
		public static var REGEX_SINGLE_COMMENT:RegExp = new RegExp( 
			"(" + HIGHLIGHT_HTML_TAG + "|" + MULTI_COMMENT + "|" + QUOTE_STRING + ")|" + 
			"(" + SINGLE_COMMENT + ")" ,"g"      
		); 
		
		/** 
		 * 匹配 数字
		 */ 
		public static var REGEX_NUMBER:RegExp = new RegExp(
			"(" + HIGHLIGHT_HTML_TAG + "|" + MULTI_COMMENT + "|" + QUOTE_STRING + "|" + SINGLE_COMMENT + ")|" + 
			"\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b","g"
		);
		
	}
}